<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::SinglePole Class Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_single_pole.html">SinglePole</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_single_pole-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::SinglePole Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="_single_pole_8h_source.html">shark/ObjectiveFunctions/Benchmarks/PoleSimulators/SinglePole.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5dddaf6857e49b1b9fb0f627d3a6ea2e" id="r_a5dddaf6857e49b1b9fb0f627d3a6ea2e"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a5dddaf6857e49b1b9fb0f627d3a6ea2e">noVars</a> () const</td></tr>
<tr class="memdesc:a5dddaf6857e49b1b9fb0f627d3a6ea2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of variables.  <br /></td></tr>
<tr class="separator:a5dddaf6857e49b1b9fb0f627d3a6ea2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7928ff59632dbc23a4b46a7d532b701e" id="r_a7928ff59632dbc23a4b46a7d532b701e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a7928ff59632dbc23a4b46a7d532b701e">SinglePole</a> (bool markovian, bool normalize=true)</td></tr>
<tr class="separator:a7928ff59632dbc23a4b46a7d532b701e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a126636632b5572c99dbdc98194c59132" id="r_a126636632b5572c99dbdc98194c59132"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a126636632b5572c99dbdc98194c59132">initDegree</a> (double state2init)</td></tr>
<tr class="memdesc:a126636632b5572c99dbdc98194c59132"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize with specific pole angle.  <br /></td></tr>
<tr class="separator:a126636632b5572c99dbdc98194c59132"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f3d9a11b06df99676eed8478ec1f757" id="r_a4f3d9a11b06df99676eed8478ec1f757"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a4f3d9a11b06df99676eed8478ec1f757">init</a> (double state2init=0.07)</td></tr>
<tr class="memdesc:a4f3d9a11b06df99676eed8478ec1f757"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize with specific pole angle.  <br /></td></tr>
<tr class="separator:a4f3d9a11b06df99676eed8478ec1f757"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10915d80c83ebb6bc866454c1b99350d" id="r_a10915d80c83ebb6bc866454c1b99350d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a10915d80c83ebb6bc866454c1b99350d">init</a> (double a, double b, double c, double d)</td></tr>
<tr class="memdesc:a10915d80c83ebb6bc866454c1b99350d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize full m_state.  <br /></td></tr>
<tr class="separator:a10915d80c83ebb6bc866454c1b99350d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84352b3865ca9ee359f2a2c2422d58d1" id="r_a84352b3865ca9ee359f2a2c2422d58d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a84352b3865ca9ee359f2a2c2422d58d1">getState</a> (RealVector &amp;v)</td></tr>
<tr class="memdesc:a84352b3865ca9ee359f2a2c2422d58d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Place m_state in a vector.  <br /></td></tr>
<tr class="separator:a84352b3865ca9ee359f2a2c2422d58d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a9ee1aca5514ed133abd001934dd892" id="r_a1a9ee1aca5514ed133abd001934dd892"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a1a9ee1aca5514ed133abd001934dd892">failure</a> ()</td></tr>
<tr class="memdesc:a1a9ee1aca5514ed133abd001934dd892"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true when this pole is in an illegal position.  <br /></td></tr>
<tr class="separator:a1a9ee1aca5514ed133abd001934dd892"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a454e9979968b1b6a4c667cde379d1e1f" id="r_a454e9979968b1b6a4c667cde379d1e1f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a454e9979968b1b6a4c667cde379d1e1f">move</a> (double output)</td></tr>
<tr class="memdesc:a454e9979968b1b6a4c667cde379d1e1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the pole with some force.  <br /></td></tr>
<tr class="separator:a454e9979968b1b6a4c667cde379d1e1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9f9f67ccd4513296a47a2b1acfbc3c33" id="r_a9f9f67ccd4513296a47a2b1acfbc3c33"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_single_pole.html#a9f9f67ccd4513296a47a2b1acfbc3c33">degrad</a> (double x)</td></tr>
<tr class="memdesc:a9f9f67ccd4513296a47a2b1acfbc3c33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert degrees to radians.  <br /></td></tr>
<tr class="separator:a9f9f67ccd4513296a47a2b1acfbc3c33"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00050">50</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7928ff59632dbc23a4b46a7d532b701e" name="a7928ff59632dbc23a4b46a7d532b701e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7928ff59632dbc23a4b46a7d532b701e">&#9670;&#160;</a></span>SinglePole()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">shark::SinglePole::SinglePole </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>markovian</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>normalize</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">markovian</td><td>Whether to return velocities in getState </td></tr>
    <tr><td class="paramname">normalize</td><td>Whether to normalize return values in getState </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00067">67</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9f9f67ccd4513296a47a2b1acfbc3c33" name="a9f9f67ccd4513296a47a2b1acfbc3c33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f9f67ccd4513296a47a2b1acfbc3c33">&#9670;&#160;</a></span>degrad()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static double shark::SinglePole::degrad </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert degrees to radians. </p>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00054">54</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_single_pole.html#a1a9ee1aca5514ed133abd001934dd892">failure()</a>.</p>

</div>
</div>
<a id="a1a9ee1aca5514ed133abd001934dd892" name="a1a9ee1aca5514ed133abd001934dd892"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a9ee1aca5514ed133abd001934dd892">&#9670;&#160;</a></span>failure()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool shark::SinglePole::failure </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns true when this pole is in an illegal position. </p>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00128">128</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_single_pole.html#a9f9f67ccd4513296a47a2b1acfbc3c33">degrad()</a>.</p>

</div>
</div>
<a id="a84352b3865ca9ee359f2a2c2422d58d1" name="a84352b3865ca9ee359f2a2c2422d58d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84352b3865ca9ee359f2a2c2422d58d1">&#9670;&#160;</a></span>getState()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::SinglePole::getState </td>
          <td>(</td>
          <td class="paramtype">RealVector &amp;&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Place m_state in a vector. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">v</td><td>vector to place m_state in (assumed to be correct size already) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00113">113</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

</div>
</div>
<a id="a10915d80c83ebb6bc866454c1b99350d" name="a10915d80c83ebb6bc866454c1b99350d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10915d80c83ebb6bc866454c1b99350d">&#9670;&#160;</a></span>init() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::SinglePole::init </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>d</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize full m_state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>initial cart position </td></tr>
    <tr><td class="paramname">b</td><td>initial cart velocity </td></tr>
    <tr><td class="paramname">c</td><td>initial pole angle (in radians) </td></tr>
    <tr><td class="paramname">d</td><td>initial pole angular velocity </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00104">104</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

</div>
</div>
<a id="a4f3d9a11b06df99676eed8478ec1f757" name="a4f3d9a11b06df99676eed8478ec1f757"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f3d9a11b06df99676eed8478ec1f757">&#9670;&#160;</a></span>init() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::SinglePole::init </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>state2init</em> = <code>0.07</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize with specific pole angle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state2init</td><td>initial pole angle (in radians) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00094">94</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_single_pole.html#a126636632b5572c99dbdc98194c59132">initDegree()</a>.</p>

</div>
</div>
<a id="a126636632b5572c99dbdc98194c59132" name="a126636632b5572c99dbdc98194c59132"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a126636632b5572c99dbdc98194c59132">&#9670;&#160;</a></span>initDegree()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::SinglePole::initDegree </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>state2init</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize with specific pole angle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state2init</td><td>initial pole angle (in degrees) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00087">87</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_single_pole.html#a4f3d9a11b06df99676eed8478ec1f757">init()</a>.</p>

</div>
</div>
<a id="a454e9979968b1b6a4c667cde379d1e1f" name="a454e9979968b1b6a4c667cde379d1e1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a454e9979968b1b6a4c667cde379d1e1f">&#9670;&#160;</a></span>move()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::SinglePole::move </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>output</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move the pole with some force. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">output</td><td>Force to apply. Expects values in [0,1], where values below 0.5 indicate applying force towards the left side and values above indicate force towards the right. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00137">137</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

</div>
</div>
<a id="a5dddaf6857e49b1b9fb0f627d3a6ea2e" name="a5dddaf6857e49b1b9fb0f627d3a6ea2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5dddaf6857e49b1b9fb0f627d3a6ea2e">&#9670;&#160;</a></span>noVars()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">unsigned shark::SinglePole::noVars </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Number of variables. </p>

<p class="definition">Definition at line <a class="el" href="_single_pole_8h_source.html#l00059">59</a> of file <a class="el" href="_single_pole_8h_source.html">SinglePole.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/ObjectiveFunctions/Benchmarks/PoleSimulators/<a class="el" href="_single_pole_8h_source.html">SinglePole.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
